﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Store.aspx.cs" Inherits="Liguo.Store.Store" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link rel="stylesheet" href="../css/cart.css" />
    <link rel="stylesheet" href="../css/store.css" />
    <title>欢迎来到利果大百货</title>
    <style type="text/css">
        .bottom {
            width: 100%;
            height: 40px;
            position: absolute;
            top: 1300px;
        }
    </style>
    <script type="text/javascript">
        function submitSearch() {
            var x = document.getElementById("frmSearch");
            x.target = "display";
            x.submit();
        }

        var goods = new Array(<%=goodsinfo%>);
    </script>
</head>
<body>
    <div style="height: 40px; width: 100%">
        <iframe src="Top.aspx"></iframe>
    </div>
    <div class="big_box">
        <div>
            <div class="logo">
                <a href="Store.aspx" target="_top">
                    <asp:Image ID="ImLogo" runat="server" ImageUrl="../res/Logo.png" />
                </a>
            </div>
            <div>
                <div class="search">
                    <form id="frmSearch" action="Display.aspx" method="post">
                        <input type="text" id="keyword" name="keyword" class="search_text" />
                        <input type="submit" id="btSearch" value="搜索" class="search_button" onclick="submitSearch();" />
                    </form>
                </div>
            </div>
        </div>
        <div class="big_block">
            <div class="navigation">
                <!--兼容IE早期版本的做法，不用在意-->
                <iframe src="Navigation.aspx#Menu=ChildMenu" frameborder="no" border="no"></iframe>
            </div>
            <div class="display">
                <iframe src="Display.aspx" name="display" frameborder="no" border="no"></iframe>
            </div>
        </div>
    </div>
    <div class="bottom">
        <!--兼容IE早期版本的做法，不用在意-->
        <iframe src="Bottom.aspx" frameborder="no" border="no"></iframe>
    </div>
    <div class="cart">
        <div class="cart_info">
            <img class="cart_icon" src="../res/cart.png" />
            <span class="cart_name">购物车</span>
            <span class="cart_rmb">￥</span>
            <script>
                document.write("<ul>");
                var count = goods.length;
                var price = 0.0;
                if (count > 0) {
                    for (i = 0; i < count; i++) {
                        price += goods[i].price;
                        document.write("<li><a href=\"Detail.aspx?ID=" + goods[i].id + "\" class=\"a_img\"><img class=\"goods_img\" src=\"../images/" + goods[i].img + ".png\" /></a>");
                        document.write("<span class=\"goods_num\">×" + goods[i].num + "</span>");
                        document.write("<a href=\"Detail.aspx?ID=" + goods[i].id + "\" class=\"goods_name\">" + goods[i].name + "</a>");
                        if (goods[i].method == 0 || goods[i].method == 2) {
                            document.write("<span class=\"goods_price\">￥" + goods[i].price.toFixed(2) + "</span></li>");
                        } else {
                            document.write("<span class=\"goods_price\">待定</span></li>");
                        }
                    }
                } else {
                    document.write("<li><span id=\"cart_none\">购物车为空</span></li>");
                }
                document.write("</ul>");
                document.write("<span class=\"cart_mon\">" + price.toFixed(2) + "</span>");
            </script>
        </div>
        <a class="cart_pay" href="Cart.aspx"><span>结算</span></a>
    </div>
</body>
</html>
